package pruebas;

import java.util.Iterator;

import silencios.SilencioDeCorchea;
import musica.*;
import figuras.*;

import junit.framework.TestCase;


public class TestCompas extends TestCase{

	public void testCompas() {
		Duracion duracion = new Duracion(1,4);
		Compas unCompas = new Compas(duracion);
		assertNotNull(unCompas);
		
		unCompas.agregarFigura(new Blanca(duracion, null));
		assertFalse(unCompas.compasVacio());
		
		unCompas.agregarFigura(new Negra(duracion, null));
		unCompas.agregarFigura(new Negra(duracion, null));
		
		// se vacia la lista de figuras del compas y se verifica si queda vacio
		Iterator i = unCompas.figurasIterator();
		Figura figura = null;
		while (i.hasNext()){
			figura = (Figura)i.next();
			i.remove();
		}
		
		assertTrue(unCompas.compasVacio());	
	}
	
}